package com.moji.controller.web;


import com.moji.common.base.ApiResult;
import com.moji.entity.MjSupportHelp;
import com.moji.entity.dto.QuerySupportHelpDto;
import com.moji.service.MjSupportHelpService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.Map;

/**
 * <p>
 * 支持与帮助表 前端控制器
 * </p>
 *
 * @author ccl
 * @since 2024-07-20
 */
@RestController
@RequestMapping("web/mjSupportHelp")
@Api(tags = "支持与帮助web相关接口", value = "支持与帮助web相关接口")
public class MjSupportHelpController {

    @Resource
    private MjSupportHelpService mjSupportHelpService;

    @PostMapping("/queryByPage")
    @ApiOperation(value = "支持与帮助_分页查询",response = MjSupportHelp.class)
    public ApiResult queryByPage(@RequestBody QuerySupportHelpDto dto){
        return ApiResult.ok(mjSupportHelpService.queryByPage(dto));
    }

    @PostMapping("/detail")
    @ApiOperation(value = "支持与帮助_详情",response = MjSupportHelp.class)
    public ApiResult detail(@RequestParam("id") Long id){
        return ApiResult.ok(mjSupportHelpService.detail(id));
    }

    @GetMapping("/down")
    @ApiOperation(value = "支持与帮助_下载",response = Map.class)
    public ApiResult down(@RequestParam("id") Long id){
        return ApiResult.ok(mjSupportHelpService.down(id));
    }
}

